<template>
  <h1>vuex</h1>
  <div>{{ $store.state.count }}</div>
  <div>{{ store.state.count }}</div>
  <div>{{ count }}</div>
  <button @click="store.commit('increment')">add</button>
</template>

<script setup>
defineOptions({
  name: 'vuexIndex'
})
import { computed } from 'vue'
import { useStore } from 'vuex'
const store = useStore()
const count = computed(() => store.state.count)
</script>

<style></style>
